package com.itheima.thread;
/*
守护线程
 */
public class Test04 {

    public static void main(String[] args) throws InterruptedException {
       // Mythread thread1 = new Mythread("女神");
     //  thread1.start();//开启线程才能运行多线程
        Mythread thread2 = new Mythread("备胎");
        thread2.setDaemon(true);//守护 的是自己所在的线程
        thread2.start();//开启线程才能运行多线程
        for (int i = 0; i < 10; i++) {
                Thread.sleep(10);
            System.out.println("这是main线程的"+i);
        }

        System.out.println("看看我打印到哪里去了");


    }
}
